package com.fh.shop.api.book.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel("图书实体类")
public class Book implements Serializable {
    @ApiModelProperty(value = "图书id",example = "0", hidden = true)
    private Long id;
    @ApiModelProperty(value = "图书名", required = true)
    private String bookName;
    @ApiModelProperty(value = "作者", required = true)
    private String author;
    @ApiModelProperty(value = "图书价格",example = "0")
    private BigDecimal price;
    @ApiModelProperty(value = "图书出版时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd") // 前台向后台传参
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createDate;

}
